import type { RequestType } from "@/utils/request";
import Http from "@/utils/request";

/**
 * 加入购物车
 * @param params
 * @returns
 */
export function addCard(params?: any) {
  return Http.request<RequestType>({
    method: "POST",
    url: "/buyer/order/cart",
    data: params,
    isJson: true,
    needToken: true,
  });
}

/**
 * 查询
 * @param params
 * @returns
 */
export function findCart(params?: any) {
  return Http.request<RequestType>({
    method: "GET",
    url: "/buyer/order/cart",
    params,
    needToken: true,
  });
}

/**
 * 修改购物车数量
 * @param params
 * @returns
 */
export function updateNum(params?: any) {
  return Http.request<RequestType>({
    method: "PUT",
    url: "/buyer/order/cart/num",
    params,
    needToken: true,
  });
}